import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2023-08-17
 * Time: 9:13
 */
class Grade implements Cloneable {
    int score=90;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class Student implements Cloneable {
    public int age = 10;
    Grade grade;
    public Student(){
        this.grade=new Grade();
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        //return super.clone();
        Student temp=(Student) super.clone();
        temp.grade=(Grade)this.grade.clone();
        return temp;
    }
}
 class Test10 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Student student1 = new Student();
        Student student2 = (Student) student1.clone();
        System.out.println("@@@@@@@@@@@@@@@@@@@@");
        student2.grade.score=78;
        System.out.println(student1.grade.score);
        System.out.println(student2.grade.score);

    }
}


class Person{
    public int age;
    public String name;
    public Person(int age,String name){
        this.age=age;
        this.name=name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return age == person.age && Objects.equals(name, person.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(age, name);
    }
}
class Test11{
    public static void main(String[] args) {
    Person person1=new Person(24,"asdfg");
    Person person2=new Person(24,"asdfg");
        System.out.println(person1.hashCode());
        System.out.println(person2.hashCode());
    }
}


/*class Outclass{
    private int a;
    static  int b;
    int c=900;
    public void methodA(){
        a=10;
        System.out.println(a);
    }
    public static void methodB(){
        System.out.println(b);
        System.out.println(d);
    }

    class InnerClass{
         int c=89;
         int d=89;
        public void methodInner(){
            c=700;
            System.out.println(this.c);

            System.out.println(Outclass.this.c);
        }
    }

    public static void main(String[] args) {
        Outclass.InnerClass innerClass1=new Outclass().new InnerClass();
        Outclass outclass2=new Outclass();
        InnerClass innerClass2=outclass2.new InnerClass();
        innerClass2.methodInner();
    }
}*/

class Person1{
    public int age;
    public String name;
    public Person1(int age,String name){
        this.age=age;
        this.name=name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }

}
class Outclass{
    private int a;
    static  int b;
    int c=900;
    public void methodA(){
        a=10;
        System.out.println(a);
    }
    public static void methodB(){
        System.out.println(b);
    }


    public static void main(String[] args) {

    }
}


 abstract class  shape{
    abstract void draw();
}

class Test21{
    public static void main(String[] args) {
        int a=45;
        new shape(){

            @Override
            void draw() {
                System.out.println("qwer"+a);
            }
        }.draw();
    }
}
